Optimal. Leaf size=122 \[ \frac {(e f+d g)^2}{8 d^2 e^3 (d-e x)^2}+\frac {e^2 f^2-d^2 g^2}{4 d^3 e^3 (d-e x)}-\frac {(e f-d g)^2}{8 d^3 e^3 (d+e x)}+\frac {(e f-d g) (3 e f+d g) \tanh ^{-1}\left (\frac {e x}{d}\right )}{8 d^4 e^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 122, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {813, 90, 214}
\begin {gather*} \frac {(d g+3 e f) (e f-d g) \tanh ^{-1}\left (\frac {e x}{d}\right )}{8 d^4 e^3}-\frac {(e f-d g)^2}{8 d^3 e^3 (d+e x)}+\frac {(d g+e f)^2}{8 d^2 e^3 (d-e x)^2}+\frac {e^2 f^2-d^2 g^2}{4 d^3 e^3 (d-e x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 214
Rule 813
Rubi steps
\begin {align*} \int \frac {(d+e x) (f+g x)^2}{\left (d^2-e^2 x^2\right )^3} \, dx &=\int \frac {(f+g x)^2}{(d-e x)^3 (d+e x)^2} \, dx\\ &=\int \left (\frac {(e f+d g)^2}{4 d^2 e^2 (d-e x)^3}+\frac {e^2 f^2-d^2 g^2}{4 d^3 e^2 (d-e x)^2}+\frac {(-e f+d g)^2}{8 d^3 e^2 (d+e x)^2}+\frac {(e f-d g) (3 e f+d g)}{8 d^3 e^2 \left (d^2-e^2 x^2\right )}\right ) \, dx\\ &=\frac {(e f+d g)^2}{8 d^2 e^3 (d-e x)^2}+\frac {e^2 f^2-d^2 g^2}{4 d^3 e^3 (d-e x)}-\frac {(e f-d g)^2}{8 d^3 e^3 (d+e x)}+\frac {((e f-d g) (3 e f+d g)) \int \frac {1}{d^2-e^2 x^2} \, dx}{8 d^3 e^2}\\ &=\frac {(e f+d g)^2}{8 d^2 e^3 (d-e x)^2}+\frac {e^2 f^2-d^2 g^2}{4 d^3 e^3 (d-e x)}-\frac {(e f-d g)^2}{8 d^3 e^3 (d+e x)}+\frac {(e f-d g) (3 e f+d g) \tanh ^{-1}\left (\frac {e x}{d}\right )}{8 d^4 e^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 140, normalized size = 1.15 \begin {gather*} \frac {\frac {2 d^2 (e f+d g)^2}{(d-e x)^2}+\frac {4 d e^2 f^2-4 d^3 g^2}{d-e x}-\frac {2 d (e f-d g)^2}{d+e x}+\left (-3 e^2 f^2+2 d e f g+d^2 g^2\right ) \log (d-e x)+\left (3 e^2 f^2-2 d e f g-d^2 g^2\right ) \log (d+e x)}{16 d^4 e^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 183, normalized size = 1.50
method | result | size |
default | \(\frac {\left (-d^{2} g^{2}-2 d e f g +3 e^{2} f^{2}\right ) \ln \left (e x +d \right )}{16 e^{3} d^{4}}-\frac {d^{2} g^{2}-2 d e f g +e^{2} f^{2}}{8 e^{3} d^{3} \left (e x +d \right )}+\frac {-d^{2} g^{2}+e^{2} f^{2}}{4 d^{3} e^{3} \left (-e x +d \right )}-\frac {-d^{2} g^{2}-2 d e f g -e^{2} f^{2}}{8 e^{3} d^{2} \left (-e x +d \right )^{2}}+\frac {\left (d^{2} g^{2}+2 d e f g -3 e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{16 e^{3} d^{4}}\) | \(183\) |
norman | \(\frac {\frac {-g^{2} d^{2} e +2 f g d \,e^{2}+f^{2} e^{3}}{4 e^{4}}+\frac {\left (d^{2} g^{2}+2 d e f g -3 e^{2} f^{2}\right ) x^{3}}{8 d^{3}}+\frac {g^{2} x^{2}}{2 e}+\frac {\left (d^{2} g^{2}+2 d e f g +5 e^{2} f^{2}\right ) x}{8 e^{2} d}}{\left (-e^{2} x^{2}+d^{2}\right )^{2}}+\frac {\left (d^{2} g^{2}+2 d e f g -3 e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{16 e^{3} d^{4}}-\frac {\left (d^{2} g^{2}+2 d e f g -3 e^{2} f^{2}\right ) \ln \left (e x +d \right )}{16 e^{3} d^{4}}\) | \(193\) |
risch | \(\frac {\frac {\left (d^{2} g^{2}+2 d e f g -3 e^{2} f^{2}\right ) x^{2}}{8 d^{3} e}+\frac {\left (3 d^{2} g^{2}-2 d e f g +3 e^{2} f^{2}\right ) x}{8 e^{2} d^{2}}-\frac {d^{2} g^{2}-2 d e f g -e^{2} f^{2}}{4 d \,e^{3}}}{\left (-e x +d \right ) \left (-e^{2} x^{2}+d^{2}\right )}+\frac {\ln \left (e x -d \right ) g^{2}}{16 e^{3} d^{2}}+\frac {\ln \left (e x -d \right ) f g}{8 e^{2} d^{3}}-\frac {3 \ln \left (e x -d \right ) f^{2}}{16 e \,d^{4}}-\frac {\ln \left (-e x -d \right ) g^{2}}{16 e^{3} d^{2}}-\frac {\ln \left (-e x -d \right ) f g}{8 e^{2} d^{3}}+\frac {3 \ln \left (-e x -d \right ) f^{2}}{16 e \,d^{4}}\) | \(236\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 201, normalized size = 1.65 \begin {gather*} -\frac {2 \, d^{4} g^{2} - 4 \, d^{3} f g e - 2 \, d^{2} f^{2} e^{2} - {\left (d^{2} g^{2} e^{2} + 2 \, d f g e^{3} - 3 \, f^{2} e^{4}\right )} x^{2} - {\left (3 \, d^{3} g^{2} e - 2 \, d^{2} f g e^{2} + 3 \, d f^{2} e^{3}\right )} x}{8 \, {\left (d^{3} x^{3} e^{6} - d^{4} x^{2} e^{5} - d^{5} x e^{4} + d^{6} e^{3}\right )}} - \frac {{\left (d^{2} g^{2} + 2 \, d f g e - 3 \, f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (x e + d\right )}{16 \, d^{4}} + \frac {{\left (d^{2} g^{2} + 2 \, d f g e - 3 \, f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (x e - d\right )}{16 \, d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 399 vs.
\(2 (119) = 238\).
time = 2.94, size = 399, normalized size = 3.27 \begin {gather*} -\frac {4 \, d^{5} g^{2} + 6 \, d f^{2} x^{2} e^{4} - 2 \, {\left (2 \, d^{2} f g x^{2} + 3 \, d^{2} f^{2} x\right )} e^{3} - 2 \, {\left (d^{3} g^{2} x^{2} - 2 \, d^{3} f g x + 2 \, d^{3} f^{2}\right )} e^{2} - 2 \, {\left (3 \, d^{4} g^{2} x + 4 \, d^{4} f g\right )} e + {\left (d^{5} g^{2} - 3 \, f^{2} x^{3} e^{5} + {\left (2 \, d f g x^{3} + 3 \, d f^{2} x^{2}\right )} e^{4} + {\left (d^{2} g^{2} x^{3} - 2 \, d^{2} f g x^{2} + 3 \, d^{2} f^{2} x\right )} e^{3} - {\left (d^{3} g^{2} x^{2} + 2 \, d^{3} f g x + 3 \, d^{3} f^{2}\right )} e^{2} - {\left (d^{4} g^{2} x - 2 \, d^{4} f g\right )} e\right )} \log \left (x e + d\right ) - {\left (d^{5} g^{2} - 3 \, f^{2} x^{3} e^{5} + {\left (2 \, d f g x^{3} + 3 \, d f^{2} x^{2}\right )} e^{4} + {\left (d^{2} g^{2} x^{3} - 2 \, d^{2} f g x^{2} + 3 \, d^{2} f^{2} x\right )} e^{3} - {\left (d^{3} g^{2} x^{2} + 2 \, d^{3} f g x + 3 \, d^{3} f^{2}\right )} e^{2} - {\left (d^{4} g^{2} x - 2 \, d^{4} f g\right )} e\right )} \log \left (x e - d\right )}{16 \, {\left (d^{4} x^{3} e^{6} - d^{5} x^{2} e^{5} - d^{6} x e^{4} + d^{7} e^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 277 vs.
\(2 (105) = 210\).
time = 0.64, size = 277, normalized size = 2.27 \begin {gather*} - \frac {2 d^{4} g^{2} - 4 d^{3} e f g - 2 d^{2} e^{2} f^{2} + x^{2} \left (- d^{2} e^{2} g^{2} - 2 d e^{3} f g + 3 e^{4} f^{2}\right ) + x \left (- 3 d^{3} e g^{2} + 2 d^{2} e^{2} f g - 3 d e^{3} f^{2}\right )}{8 d^{6} e^{3} - 8 d^{5} e^{4} x - 8 d^{4} e^{5} x^{2} + 8 d^{3} e^{6} x^{3}} + \frac {\left (d g - e f\right ) \left (d g + 3 e f\right ) \log {\left (- \frac {d \left (d g - e f\right ) \left (d g + 3 e f\right )}{e \left (d^{2} g^{2} + 2 d e f g - 3 e^{2} f^{2}\right )} + x \right )}}{16 d^{4} e^{3}} - \frac {\left (d g - e f\right ) \left (d g + 3 e f\right ) \log {\left (\frac {d \left (d g - e f\right ) \left (d g + 3 e f\right )}{e \left (d^{2} g^{2} + 2 d e f g - 3 e^{2} f^{2}\right )} + x \right )}}{16 d^{4} e^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.61, size = 195, normalized size = 1.60 \begin {gather*} -\frac {{\left (d^{2} g^{2} + 2 \, d f g e - 3 \, f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left ({\left | x e + d \right |}\right )}{16 \, d^{4}} + \frac {{\left (d^{2} g^{2} + 2 \, d f g e - 3 \, f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left ({\left | x e - d \right |}\right )}{16 \, d^{4}} - \frac {{\left (2 \, d^{5} g^{2} - 4 \, d^{4} f g e - 2 \, d^{3} f^{2} e^{2} - {\left (d^{3} g^{2} e^{2} + 2 \, d^{2} f g e^{3} - 3 \, d f^{2} e^{4}\right )} x^{2} - {\left (3 \, d^{4} g^{2} e - 2 \, d^{3} f g e^{2} + 3 \, d^{2} f^{2} e^{3}\right )} x\right )} e^{\left (-3\right )}}{8 \, {\left (x e + d\right )} {\left (x e - d\right )}^{2} d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.64, size = 198, normalized size = 1.62 \begin {gather*} \frac {\frac {-d^2\,g^2+2\,d\,e\,f\,g+e^2\,f^2}{4\,d\,e^3}+\frac {x\,\left (3\,d^2\,g^2-2\,d\,e\,f\,g+3\,e^2\,f^2\right )}{8\,d^2\,e^2}+\frac {x^2\,\left (d^2\,g^2+2\,d\,e\,f\,g-3\,e^2\,f^2\right )}{8\,d^3\,e}}{d^3-d^2\,e\,x-d\,e^2\,x^2+e^3\,x^3}-\frac {\mathrm {atanh}\left (\frac {e\,x\,\left (d\,g-e\,f\right )\,\left (d\,g+3\,e\,f\right )}{d\,\left (d^2\,g^2+2\,d\,e\,f\,g-3\,e^2\,f^2\right )}\right )\,\left (d\,g-e\,f\right )\,\left (d\,g+3\,e\,f\right )}{8\,d^4\,e^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________